package com.Test.www;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-24
 * Time: 18:53
 */
class Animal {
    public String name;
    public int age;
    static {
        System.out.println("Animal::static {}   4");//4
    }

    {
        System.out.println("Animal::{}   5");//5
    }
    public Animal(String name,int age) {
        this.name=name;
        this.age=age;
        System.out.println("Animal带2个参数的构造方法   6");//6
    }
}

class Cat extends Animal {
    static {
        System.out.println("Cat::static {}  1");//1
    }
    {
        System.out.println("Cat::{}    2");//2
    }
    public Cat(String name,int age) {
        super(name,age);
        System.out.println("Cat带2个参数的构造    3");//3
    }
}
public class Main{
    public static void main(String[] args) {
        Cat cat = new Cat("小花",4);
    }
}